(function() {
  var MyFormView, WineDetailsView, mediator, template,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  MyFormView = require('views/base/custom/my_form_view');

  template = require('views/templates/wine_details');

  module.exports = WineDetailsView = (function(_super) {

    __extends(WineDetailsView, _super);

    WineDetailsView.name = 'WineDetailsView';

    function WineDetailsView() {
      this.updateModelFromView = __bind(this.updateModelFromView, this);

      this.getDeleteButtonName = __bind(this.getDeleteButtonName, this);

      this.getSaveButtonName = __bind(this.getSaveButtonName, this);
      return WineDetailsView.__super__.constructor.apply(this, arguments);
    }

    WineDetailsView.prototype.template = template;

    WineDetailsView.prototype.className = 'wine-details';

    WineDetailsView.prototype.id = 'wine-details';

    WineDetailsView.prototype.getSaveButtonName = function() {
      return '.saveWine';
    };

    WineDetailsView.prototype.getDeleteButtonName = function() {
      return '.deleteWine';
    };

    WineDetailsView.prototype.initialize = function() {
      return WineDetailsView.__super__.initialize.apply(this, arguments);
    };

    WineDetailsView.prototype.updateModelFromView = function() {
      return this.model.set({
        name: $('#name').val(),
        grapes: $('#grapes').val(),
        country: $('#country').val(),
        region: $('#region').val(),
        year: $('#year').val(),
        description: $('#description').val()
      });
    };

    return WineDetailsView;

  })(MyFormView);

}).call(this);
